<?php

class EmbeddedAddressForm extends AddressForm {
	
	public function configure() {
		parent::configure();
		
		unset($this['member_list']);
		
		$this->validatorSchema['street']->setOption('required', false);
		$this->validatorSchema['street_number']->setOption('required', false);
		$this->validatorSchema['additional_information']->setOption('required', false);
		$this->validatorSchema['zip_code']->setOption('required', false);
		$this->validatorSchema['city']->setOption('required', false);
		$this->validatorSchema['country_id']->setOption('required', false);
		
		$this->widgetSchema->setLabels(array('street' => 'Straße', 'street_number' => 'Hausnummer', 'zip_code' => 'Postleitzahl', 'city' => 'Stadt', 'country_id' => 'Land', 'address_addition' => 'Adresszusatz'));
	}
	
	/**
	 * Checks if form values are blank
	 * 
	 * @param array $values
	 * @return boolean
	 */
	public static function formValuesAreBlank(array $values) {
		$fieldNames = array(
			'street', 'street_number', 'zip_code', 'city');
		return parent::__formValuesAreBlank($fieldNames, $values);
	}
}